

require('./common/runtime.js')
require('./common/vendor.js')
require('./common/main.js')
App({
  globalData: {
    apiBaseUrl:'https://babyplanet.isv-dev.youzan.com/api/',
    apiToken:'ca3686fe23e4c9bec6c870d6d6e8f60',
    questionId:1
  },
  onLaunch: function () {

    // 自定义头部
    let menuButtonObject = wx.getMenuButtonBoundingClientRect(); //获取菜单按钮（右上角胶囊按钮）的布局位置信息。坐标信息以屏幕左上角为原点。
    console.log(menuButtonObject)
    wx.getSystemInfo({//获取系统信息
      success: res => {
        let statusBarHeight = res.statusBarHeight,//状态栏的高度，单位px
          navTop = menuButtonObject.top,//胶囊按钮与顶部的距离
          navHeight = statusBarHeight + menuButtonObject.height + (menuButtonObject.top - statusBarHeight)*2;//导航高度
           this.globalData.navHeight = navHeight;
           this.globalData.navTop = navTop;
           this.globalData.windowHeight = res.windowHeight;//可使用窗口高度，单位px
           console.log(navHeight,navTop)
      },
      fail(err) {
        console.log(err);
      }
    })

 },

})